<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>模组库</title>
    <script type="text/javascript" src="saveMoudle/Ajax/getQuestionsForMoudleAjax.js"></script>
    <script type="text/javascript" src="saveMoudle/Ajax/addQuestionsMoudleAjax.js"></script>
    <script type="text/javascript" src="saveMoudle/Ajax/getMoudleAjax.js"></script>
    <script type="text/javascript" src="saveMoudle/Ajax/getQuestionInfoFromMoudleAjax.js"></script>
    <script type="text/javascript" src="saveMoudle/Ajax/deleteMoudleAjax.js"></script>
</head>
<script>
    $(function () {
        //加载该页面前，先判断该模块的权限
        //获取当前登录的用户的权限
        var permission = document.cookie.split(";")[1].split("=")[1];
        var b = String(permission).split('');
        for (var i = 0; i < b.length; i++) {
            console.log(b[i]);
        }
        var moudle11 = b[2];
        //如果模块权限为1，即只能查询此模块下的数据，不能进行修改（禁用和重置密码不能使用）
        //系统管理
        if (moudle12 == 1) {
            $(".input-update").attr("disabled","disabled");
            $(".input-del").attr("disabled","disabled");
        }
    })
</script>

<style type="text/css">
    table {
        width: 100%;
    }

    .selected {
        color: white;
        height: 25px;
        width: 100px;
        margin-top: 10px;
        margin-bottom: 20px;
        margin-left: 50px;
        border-color: #1ab7ea;
        appearance: none;
        -moz-appearance: none;
        -webkit-appearance: none;
        background: url("http://ourjs.github.io/static/2015/arrow.png") no-repeat scroll right center transparent;
    }

    #input-seach {
        position: absolute;
        margin-left: 550px;
        margin-top: 6px;
        height: 30px;
        width: 300px;
        border: violet 2px solid;
    }

    #a-add {
        position: absolute;
        font-size: 80px;
        color: aquamarine;
        margin-left: 890px;
        margin-top: -35px;
        text-decoration: none;
    }

    .input-del, .input-update {
        height: 30px;
        width: 60px;
        border: none;
        background-color: orange;
        font-size: medium;
        margin-left: 20px;
    }

    td {
        text-align: center;
    }

    #buttons-seach {
        position: absolute;
        margin-left: 860px;
        margin-top: 10px;
        border: none;
        background-color: black;
        font-size: large;
    }

    #div-cutpage {

        position: absolute;
        margin-top: -20px;
        margin-left: 800px;
    }

</style>
<body>
<div style="height: 60px;width: 100%;background-color: black">
    <input type="text" placeholder="搜索..." id="input-seach">
    <input type="button" value="🔍" id="buttons-seach" onclick="getMoudles()">
    <select name="" id="choose-scope" class="selected" onchange="getMoudles()">
        <option value="0">全部</option>
        <option value="1">消费性</option>
        <option value="2">经营性</option>
        <option value="3">按揭性</option>
    </select>

    <a href="#" value="添加" id="a-add" data-toggle="modal" data-target="#addQuestionMoudle"
       onclick="getQuestionsByType()">+</a>
</div>

<div class="grid-table" style="height: 615px;width: 100%;">


    <table class="">
        <thead style="background-color:skyblue">
        <tr>
            <td>模组ID</td>
            <td>模组名称</td>
            <td>适用范围</td>
            <td>问题</td>
            <td>操作</td>
        </tr>
        </thead>
        <tbody>
        <tr class="moudle-tr" style="display: none">
            <td>11</td>
            <td>11</td>
            <td>22</td>
            <td><input type="button" value="查看" data-toggle="modal" data-target="#getQuestioninfoMoudle" style=""
                       class="button-lookquestion" onclick="getQuestionsInfoByMoudleID(this)"></td>
            <td>
                <input type="button" class="input-update" value="修改" data-toggle="modal"
                       data-target="#addQuestionMoudle" onclick="getQuestionsByType(this)">
                <input type="button" class="input-del" value="删除" onclick="deleteMoudle(this)">
            </td>
        </tr>

        <tr class="moudle-tr" style="display: none">
            <td>11</td>
            <td>11</td>
            <td>22</td>
            <td><input type="button" value="查看" data-toggle="modal" data-target="#getQuestioninfoMoudle" style=""
                       class="button-lookquestion" onclick="getQuestionsInfoByMoudleID(this)"></td>
            <td>
                <input type="button" class="input-update" value="修改" data-toggle="modal"
                       data-target="#addQuestionMoudle" onclick="getQuestionsByType(this)">
                <input type="button" class="input-del" value="删除" onclick="deleteMoudle(this)">
            </td>
        </tr>

        <tr class="moudle-tr" style="display: none">
            <td>11</td>
            <td>11</td>
            <td>22</td>
            <td><input type="button" value="查看" data-toggle="modal" data-target="#getQuestioninfoMoudle" style=""
                       class="button-lookquestion" onclick="getQuestionsInfoByMoudleID(this)"></td>
            <td>
                <input type="button" class="input-update" value="修改" data-toggle="modal"
                       data-target="#addQuestionMoudle" onclick="getQuestionsByType(this)">
                <input type="button" class="input-del" value="删除" onclick="deleteMoudle(this)">
            </td>
        </tr>

        <tr class="moudle-tr" style="display: none">
            <td>11</td>
            <td>11</td>
            <td>22</td>
            <td><input type="button" value="查看" data-toggle="modal" data-target="#getQuestioninfoMoudle" style=""
                       class="button-lookquestion" onclick="getQuestionsInfoByMoudleID(this)"></td>
            <td>
                <input type="button" class="input-update" value="修改" data-toggle="modal"
                       data-target="#addQuestionMoudle" onclick="getQuestionsByType(this)">
                <input type="button" class="input-del" value="删除" onclick="deleteMoudle(this)">
            </td>
        </tr>

        <tr class="moudle-tr" style="display: none">
            <td>11</td>
            <td>11</td>
            <td>22</td>
            <td><input type="button" value="查看" data-toggle="modal" data-target="#getQuestioninfoMoudle" style=""
                       class="button-lookquestion" onclick="getQuestionsInfoByMoudleID(this)"></td>
            <td>
                <input type="button" class="input-update" value="修改" data-toggle="modal"
                       data-target="#addQuestionMoudle" onclick="getQuestionsByType(this)">
                <input type="button" class="input-del" value="删除" onclick="deleteMoudle(this)">
            </td>
        </tr>

        <tr class="moudle-tr" style="display: none">
            <td>11</td>
            <td>11</td>
            <td>22</td>
            <td><input type="button" value="查看" data-toggle="modal" data-target="#getQuestioninfoMoudle" style=""
                       class="button-lookquestion" onclick="getQuestionsInfoByMoudleID(this)"></td>
            <td>
                <input type="button" class="input-update" value="修改" data-toggle="modal"
                       data-target="#addQuestionMoudle" onclick="getQuestionsByType(this)">
                <input type="button" class="input-del" value="删除" onclick="deleteMoudle(this)">
            </td>
        </tr>


        <tr class="moudle-tr" style="display: none">
            <td>11</td>
            <td>11</td>
            <td>22</td>
            <td><input type="button" value="查看" data-toggle="modal" data-target="#getQuestioninfoMoudle" style=""
                       class="button-lookquestion" onclick="getQuestionsInfoByMoudleID(this)"></td>
            <td>
                <input type="button" class="input-update" value="修改" data-toggle="modal"
                       data-target="#addQuestionMoudle" onclick="getQuestionsByType(this)">
                <input type="button" class="input-del" value="删除" onclick="deleteMoudle(this)">
            </td>
        </tr>

        <tr class="moudle-tr" style="display: none">
            <td>11</td>
            <td>11</td>
            <td>22</td>
            <td><input type="button" value="查看" data-toggle="modal" data-target="#getQuestioninfoMoudle" style=""
                       class="button-lookquestion" onclick="getQuestionsInfoByMoudleID(this)"></td>
            <td>
                <input type="button" class="input-update" value="修改" data-toggle="modal"
                       data-target="#addQuestionMoudle" onclick="getQuestionsByType(this)">
                <input type="button" class="input-del" value="删除" onclick="deleteMoudle(this)">
            </td>
        </tr>

        <tr class="moudle-tr" style="display: none">
            <td>11</td>
            <td>11</td>
            <td>22</td>
            <td><input type="button" value="查看" data-toggle="modal" data-target="#getQuestioninfoMoudle" style=""
                       class="button-lookquestion" onclick="getQuestionsInfoByMoudleID(this)"></td>
            <td>
                <input type="button" class="input-update" value="修改" data-toggle="modal"
                       data-target="#addQuestionMoudle" onclick="getQuestionsByType(this)">
                <input type="button" class="input-del" value="删除" onclick="deleteMoudle(this)">
            </td>
        </tr>

        <tr class="moudle-tr" style="display: none">
            <td>11</td>
            <td>11</td>
            <td>22</td>
            <td><input type="button" value="查看" data-toggle="modal" data-target="#getQuestioninfoMoudle" style=""
                       class="button-lookquestion" onclick="getQuestionsInfoByMoudleID(this)"></td>
            <td>
                <input type="button" class="input-update" value="修改" data-toggle="modal"
                       data-target="#addQuestionMoudle" onclick="getQuestionsByType(this)">
                <input type="button" class="input-del" value="删除" onclick="deleteMoudle(this)">
            </td>
        </tr>

        <tr class="moudle-tr" style="display: none">
            <td>11</td>
            <td>11</td>
            <td>22</td>
            <td><input type="button" value="查看" data-toggle="modal" data-target="#getQuestioninfoMoudle" style=""
                       class="button-lookquestion" onclick="getQuestionsInfoByMoudleID(this)"></td>
            <td>
                <input type="button" class="input-update" value="修改" data-toggle="modal"
                       data-target="#addQuestionMoudle" onclick="getQuestionsByType(this)">
                <input type="button" class="input-del" value="删除" onclick="deleteMoudle(this)">
            </td>
        </tr>
        </tbody>
    </table>

</div>
<div id="grid-pager" class="box-footer" style="background-color:#ecf0f5">
    <div id="div-cutpage">
        <a href="#" onclick="gohead()">首页</a>
        <a href="#" onclick="devPage()">上一页</a>
        <a href="#" onclick="addPage()">下一页</a>
        <select id="a-jump" onchange="jumpPage()">

        </select>
        当前第<a id="a-index"></a>页,
        共<a id="a-sum"></a>页
    </div>

</div>
<div class="modal fade bs-example-modal-lg" id="addQuestionMoudle" tabindex="-1" role="dialog">
    <div class="modal-dialog modal-lg" role="document">
        <form id="editPasswordForm" role="form" class="form-horizontal">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                            aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title" id="indexModeltitle">添加模组</h4>
                </div>

                <div class="modal-body">
                    <div class="col-xs-8 col-xs-offset-2">
                        <input type="hidden" id="indexId" name="indexId" value="0"/>

                        <div class="form-group" id="div-id">
                            <label for="moudle-name" class="col-sm-2 control-label">模组id：</label>
                            <div class="col-sm-6">
                                <input type="text" class="form-control-static" disabled="disabled"
                                       style="width: 260px;height: 34px" id="moudle-id" name="indexMechanismCode"
                                       onchange="checkNotNullForMoudle()" value="">
                            </div>
                        </div>

                        <div class="form-group" id="div-name">
                            <label for="moudle-name" class="col-sm-2 control-label">模组名：</label>
                            <div class="col-sm-6">
                                <input type="text" class="form-control" id="moudle-name" name="indexMechanismCode"
                                       onchange="checkNotNullForMoudle()" value="">
                            </div>
                        </div>

                        <div class="form-group">
                            <label for="scope" class="col-sm-2 control-label" onclick="" id="select-scope">范围：</label>
                            <div class="col-sm-6">
                                <select class="form-control" id="scope" onchange="getQuestionsByType(this)">
                                    <option value="1">消费性</option>
                                    <option value="2">经营性</option>
                                    <option value="3">按揭性</option>
                                </select>
                            </div>
                        </div>

                        <div class="form-group">
                            <label for="select-question1" class="col-sm-2 control-label" onclick=""
                                   id="lable-question1">问题一：</label>
                            <div class="col-sm-6">
                                <select class="form-control" id="select-question1" onmousedown="getOldvalue(this)"
                                        onchange="checkNotRepeat(this)">
                                    <option selected value="0">请选择</option>
                                </select>
                            </div>
                        </div>

                        <div class="form-group">
                            <label for="select-question2" class="col-sm-2 control-label" onclick=""
                                   id="lable-question2">问题二：</label>
                            <div class="col-sm-6">
                                <select class="form-control" id="select-question2" onmousedown="getOldvalue(this)"
                                        onchange="checkNotRepeat(this)">
                                    <option selected value="0">请选择</option>
                                </select>
                            </div>
                        </div>

                        <div class="form-group">
                            <label for="select-question3" class="col-sm-2 control-label" onclick=""
                                   id="lable-question3">问题三：</label>
                            <div class="col-sm-6">
                                <select class="form-control" id="select-question3" onmousedown="getOldvalue(this)"
                                        onchange="checkNotRepeat(this)">
                                    <option selected value="0">请选择</option>
                                </select>
                            </div>
                        </div>

                        <div class="form-group">
                            <label for="select-question4" class="col-sm-2 control-label" onclick=""
                                   id="lable-question4">问题四：</label>
                            <div class="col-sm-6">
                                <select class="form-control" id="select-question4" onmousedown="getOldvalue(this)"
                                        onchange="checkNotRepeat(this)">
                                    <option selected value="0">请选择</option>
                                </select>
                            </div>
                        </div>

                        <div class="form-group">
                            <label for="select-question5" class="col-sm-2 control-label" onclick=""
                                   id="lable-question5">问题五：</label>
                            <div class="col-sm-6">
                                <select class="form-control" id="select-question5" onmousedown="getOldvalue(this)"
                                        onchange="checkNotRepeat(this)">
                                    <option selected value="0">请选择</option>
                                </select>
                            </div>
                        </div>

                        <div class="form-group">
                            <label for="select-question6" class="col-sm-2 control-label" onclick=""
                                   id="lable-question6">问题六：</label>
                            <div class="col-sm-6">
                                <select class="form-control" id="select-question6" onmousedown="getOldvalue(this)"
                                        onchange="checkNotRepeat(this)">
                                    <option selected value="0">请选择</option>
                                </select>
                            </div>
                        </div>

                        <div class="form-group">
                            <label for="select-question7" class="col-sm-2 control-label" onclick=""
                                   id="lable-question7">问题七：</label>
                            <div class="col-sm-6">
                                <select class="form-control" id="select-question7" onmousedown="getOldvalue(this)"
                                        onchange="checkNotRepeat(this)">
                                    <option selected value="0">请选择</option>
                                </select>
                            </div>
                        </div>

                        <div class="form-group">
                            <label for="select-question8" class="col-sm-2 control-label" onclick=""
                                   id="lable-question8">问题八：</label>
                            <div class="col-sm-6">
                                <select class="form-control" id="select-question8" onmousedown="getOldvalue(this)"
                                        onchange="checkNotRepeat(this)">
                                    <option selected value="0">请选择</option>
                                </select>
                            </div>
                        </div>

                        <div class="form-group">
                            <label for="select-question9" class="col-sm-2 control-label" onclick=""
                                   id="lable-question9">问题九：</label>
                            <div class="col-sm-6">
                                <select class="form-control" id="select-question9" onmousedown="getOldvalue(this)"
                                        onchange="checkNotRepeat(this)">
                                    <option selected value="0">请选择</option>
                                </select>
                            </div>
                        </div>

                        <div class="form-group">
                            <label for="select-question10" class="col-sm-2 control-label" onclick=""
                                   id="lable-question10">问题十：</label>
                            <div class="col-sm-6">
                                <select class="form-control" id="select-question10" onmousedown="getOldvalue(this)"
                                        onchange="checkNotRepeat(this)">
                                    <option selected value="0">请选择</option>
                                </select>
                            </div>
                        </div>

                    </div>
                    <div class="clearfix"></div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal"><i
                            class="fa fa-close button-in-i"></i>取消
                    </button>
                    <button type="button" class="btn btn-primary" data-dismiss="modal" id="indexUpdateBtn"
                            onclick="addQuestionsMoudle()"><i class="fa fa-check button-in-i"></i>保存
                    </button>
                    <span></span>
                </div>
            </div>
        </form>
    </div>
</div>

<div class="modal fade bs-example-modal-lg" id="getQuestioninfoMoudle" tabindex="-1" role="dialog">
    <div class="modal-dialog modal-lg" role="document">
        <form id="editPasswordForm2" role="form" class="form-horizontal">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                            aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title" id="indexModeltitle2">查看模组</h4>
                </div>

                <div class="modal-body">
                    <div class="col-xs-8 col-xs-offset-2">

                        <div class="form-group">
                            <label for="input-name1" class="col-sm-2 control-label" onclick=""
                                   id="lable-moudlequestion1">问题一：</label>
                            <div class="col-sm-6">
                                <input type="text" class="form-control" id="input-name1" name="indexMechanismCode"
                                       disabled="true" value="">
                            </div>
                            <label for="select1" class="col-sm-2 control-label" onclick=""
                                   id="lable-select1">选项：</label>
                            <div class="col-sm-6" style="position: absolute;margin-left: 500px;margin-top: 5px">
                                <select class="select-questionAnswer" style="width: 200px" id="select1">
                                    <option value="0" selected="selected">点击查看</option>
                                </select>
                            </div>
                        </div>

                        <div class="form-group">
                            <label for="input-name2" class="col-sm-2 control-label" onclick=""
                                   id="lable-moudlequestion2">问题二：</label>
                            <div class="col-sm-6">
                                <input type="text" class="form-control" id="input-name2" name="indexMechanismCode"
                                       disabled="true" value="">
                            </div>
                            <label for="select2" class="col-sm-2 control-label" onclick=""
                                   id="lable-select2">选项：</label>
                            <div class="col-sm-6" style="position: absolute;margin-left: 500px;margin-top: 5px">
                                <select class="select-questionAnswer" style="width: 200px" id="select2">
                                    <option value="0" selected="selected">点击查看</option>
                                </select>
                            </div>
                        </div>

                        <div class="form-group">
                            <label for="input-name3" class="col-sm-2 control-label" onclick=""
                                   id="lable-moudlequestion3">问题三：</label>
                            <div class="col-sm-6">
                                <input type="text" class="form-control" id="input-name3" name="indexMechanismCode"
                                       disabled="true" value="">
                            </div>
                            <label for="select3" class="col-sm-2 control-label" onclick=""
                                   id="lable-select3">选项：</label>
                            <div class="col-sm-6" style="position: absolute;margin-left: 500px;margin-top: 5px">
                                <select class="select-questionAnswer" style="width: 200px" id="select3">
                                    <option value="0" selected="selected">点击查看</option>
                                </select>
                            </div>
                        </div>

                        <div class="form-group">
                            <label for="input-name4" class="col-sm-2 control-label" onclick=""
                                   id="lable-moudlequestion4">问题四：</label>
                            <div class="col-sm-6">
                                <input type="text" class="form-control" id="input-name4" name="indexMechanismCode"
                                       disabled="true" value="">
                            </div>
                            <label for="select4" class="col-sm-2 control-label" onclick=""
                                   id="lable-select4">选项：</label>
                            <div class="col-sm-6" style="position: absolute;margin-left: 500px;margin-top: 5px">
                                <select class="select-questionAnswer" style="width: 200px" id="select4">
                                    <option value="0" selected="selected">点击查看</option>
                                </select>
                            </div>
                        </div>

                        <div class="form-group">
                            <label for="input-name5" class="col-sm-2 control-label" onclick=""
                                   id="lable-moudlequestion5">问题五：</label>
                            <div class="col-sm-6">
                                <input type="text" class="form-control" id="input-name5" name="indexMechanismCode"
                                       disabled="true" value="">
                            </div>
                            <label for="select5" class="col-sm-2 control-label" onclick=""
                                   id="lable-select5">选项：</label>
                            <div class="col-sm-6" style="position: absolute;margin-left: 500px;margin-top: 5px">
                                <select class="select-questionAnswer" style="width: 200px" id="select5">
                                    <option value="0" selected="selected">点击查看</option>
                                </select>
                            </div>
                        </div>

                        <div class="form-group">
                            <label for="input-name6" class="col-sm-2 control-label" onclick=""
                                   id="lable-moudlequestion6">问题六：</label>
                            <div class="col-sm-6">
                                <input type="text" class="form-control" id="input-name6" name="indexMechanismCode"
                                       disabled="true" value="">
                            </div>
                            <label for="select6" class="col-sm-2 control-label" onclick=""
                                   id="lable-select6">选项：</label>
                            <div class="col-sm-6" style="position: absolute;margin-left: 500px;margin-top: 5px">
                                <select class="select-questionAnswer" style="width: 200px" id="select6">
                                    <option value="0" selected="selected">点击查看</option>
                                </select>
                            </div>
                        </div>

                        <div class="form-group">
                            <label for="input-name7" class="col-sm-2 control-label" onclick=""
                                   id="lable-moudlequestion7">问题七：</label>
                            <div class="col-sm-6">
                                <input type="text" class="form-control" id="input-name7" name="indexMechanismCode"
                                       disabled="true" value="">
                            </div>
                            <label for="select7" class="col-sm-2 control-label" onclick=""
                                   id="lable-select7">选项：</label>
                            <div class="col-sm-6" style="position: absolute;margin-left: 500px;margin-top: 5px">
                                <select class="select-questionAnswer" style="width: 200px" id="select7">
                                    <option value="0" selected="selected">点击查看</option>
                                </select>
                            </div>
                        </div>

                        <div class="form-group">
                            <label for="input-name8" class="col-sm-2 control-label" onclick=""
                                   id="lable-moudlequestion8">问题八：</label>
                            <div class="col-sm-6">
                                <input type="text" class="form-control" id="input-name8" name="indexMechanismCode"
                                       disabled="true" value="">
                            </div>
                            <label for="select8" class="col-sm-2 control-label" onclick=""
                                   id="lable-select8">选项：</label>
                            <div class="col-sm-6" style="position: absolute;margin-left: 500px;margin-top: 5px">
                                <select class="select-questionAnswer" style="width: 200px" id="select8">
                                    <option value="0" selected="selected">点击查看</option>
                                </select>
                            </div>
                        </div>

                        <div class="form-group">
                            <label for="input-name9" class="col-sm-2 control-label" onclick=""
                                   id="lable-moudlequestion9">问题九：</label>
                            <div class="col-sm-6">
                                <input type="text" class="form-control" id="input-name9" name="indexMechanismCode"
                                       disabled="true" value="">
                            </div>
                            <label for="select9" class="col-sm-2 control-label" onclick=""
                                   id="lable-select9">选项：</label>
                            <div class="col-sm-6" style="position: absolute;margin-left: 500px;margin-top: 5px">
                                <select class="select-questionAnswer" style="width: 200px" id="select9">
                                    <option value="0" selected="selected">点击查看</option>
                                </select>
                            </div>
                        </div>

                        <div class="form-group">
                            <label for="input-name10" class="col-sm-2 control-label" onclick=""
                                   id="lable-moudlequestion10">问题十：</label>
                            <div class="col-sm-6">
                                <input type="text" class="form-control" id="input-name10" name="indexMechanismCode"
                                       disabled="true" value="">
                            </div>
                            <label for="select10" class="col-sm-2 control-label" onclick=""
                                   id="lable-select10">选项：</label>
                            <div class="col-sm-6" style="position: absolute;margin-left: 500px;margin-top: 5px">
                                <select class="select-questionAnswer" style="width: 200px" id="select10">
                                    <option value="0" selected="selected">点击查看</option>
                                </select>
                            </div>
                        </div>

                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal"><i
                            class="fa fa-close button-in-i"></i>关闭
                    </button>

                    <span></span>
                </div>
            </div>
        </form>
    </div>
</div>
</body>
</html>